package rpc.provider.consumer;

/**
 * @author: cuiyutian1
 * @date: 2021/9/4 13:11
 * @description:
 */
public class SoaResponse<T> {
    private T data;
    private String errorMsg;
    private String displayMsg;
    private String code;

    public String getDisplayMsg() {
        return displayMsg;
    }

    public void setDisplayMsg(String displayMsg) {
        this.displayMsg = displayMsg;
    }

    public SoaResponse() {
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getErrorMsg() {
        return errorMsg;
    }
    public void setDisplayMsg(SoaErrorEnum displayMsg) {
        this.displayMsg = displayMsg.getMsg();
    }
    public void setErrorMsg(SoaErrorEnum errorMsg) {
        this.errorMsg = errorMsg.getMsg();
    }
    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
    public void setCode(SoaErrorEnum code) {
        this.code = code.getCode();
    }
    public SoaResponse(T data, SoaErrorEnum errorEnum) {
        this.data = data;
        this.errorMsg = errorEnum.getMsg();
        this.code = errorEnum.getCode();
    }

    public SoaResponse(T data, String errorMsg, String code) {
        this.data = data;
        this.errorMsg = errorMsg;
        this.code = code;
    }
}
